'use strict'

let {Sequelize,DataTypes} = require('sequelize');

let seq = new Sequelize('soft2','postgres','qq_112358',{
    host:'172.16.10.214',
    dialect:'postgres'
});

function defineModel(name,obj){
    let attrs= {};
    attrs.id={
        type:DataTypes.BIGINT,
        primaryKey:true
    };
    for(let key in obj){
        attrs[key]=obj[key];
    }

    attrs.remarks={
        type:DataTypes.STRING(800)
    }
    let model =seq.define(name,attrs);
    return model;
}

let obj = {
    sequelize:seq,
    defineModel,
    DataTypes
}

module.exports = obj;